package com.survey.wxapp.controller;

import com.survey.common.annotation.Anonymous;
import com.survey.common.core.controller.BaseController;
import com.survey.common.core.domain.AjaxResult;
import com.survey.system.domain.SurIssuePreset;
import com.survey.system.service.ISurIssuePresetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Anonymous
@RestController
@RequestMapping("/wx/issuePreset")
public class WxIssuePresetController extends BaseController {
    @Autowired
    private ISurIssuePresetService isurIssuePresetService;

    @PostMapping("/list")
    public AjaxResult list(@RequestBody SurIssuePreset surIssuePreset) {
        Long schoolId = surIssuePreset.getSchoolId();
        String typeId = surIssuePreset.getTypeId();
        SurIssuePreset param = new SurIssuePreset();
        param.setTypeId(typeId);
        List<SurIssuePreset> list = isurIssuePresetService.selectSurIssuePresetList(param);
        List<SurIssuePreset> surIssuePresets = isurIssuePresetService.filterList(list, schoolId);
        return success(surIssuePresets);
    }
}
